<template>
	<view class="content">
		<u-select v-model="uploadShow" :list="list" @confirm="confirm"></u-select>
		<u-input :value="value" placeholder="本地上传APK/上传URL地址" border="surround"></u-input>
		<view class="upload">
			<view>请粘贴填APK的URL地址</view>
			<view class="link" @click="uploadApp">点击上传本地APK</view>
			<view class="execute"><text>执行</text></view>
		</view>
		<view class="upload">
			<view>应用详情</view>
			<view class="lfet box box-align-center">
				<view class="left_app">
					<view class="box box-pack-center">
						<view class="app_img">
							<image src="http://zuoyepad.oss-cn-beijing.aliyuncs.com/homework/16294452737235.png"
								mode=""></image>
						</view>
					</view>
				</view>
				<view class="centent">
					<view class="txt">叽里呱啦儿童英语</view>
					<view class="txt">版本号</view>
					<view class="txt">文件大小</view>
				</view>
			</view>
		</view>
		<view class="upload box box-pack-between box-align-center" @click="uploadShow = true">
			<view>下载类型</view>
			<view>{{txt}}</view>
		</view>
		<view class="deploy_btn">确定部署</view>
	</view>
	</view>
</template>

<script>
	export default {
		data() {
			return {
				value: '',
				uploadShow: false,
				list: [{value: '1',label: '静默安装'},{value: '2',label: '非强制下载'}],
				txt: ''
			}
		},
		methods: {
			confirm(e) {
				console.log('--------',e)
				this.txt = e[0].label
			},
			uploadApp() {
				// uni.chooseMessageFile({
				// 	count: 1,
				// 	type: 'all',
				// 	success(res) {
				// 		// tempFilePath可以作为img标签的src属性显示图片
				// 		console.log('------------', res, res.tempFiles[0])
				// 		uni.uploadFile({
				// 			url: 'http://homework.uiuios.com/admin/app/uploadApp', //仅为示例，非真实的接口地址
				// 			filePath: res.tempFiles[0].path,
				// 			name: 'file',
				// 			formData: {
				// 				userId: '5',
				// 				lastIp: '127.0.0.1'
				// 			},
				// 			success: (uploadFileRes) => {
				// 				console.log(uploadFileRes.data);
				// 			},
				// 			fail: (res) => {
				// 				console.log('失败了', res)
				// 			}

				// 		});
				// 	}
				// })
			}
		}
	}
</script>

<style lang="scss" scoped>
	.upload {
		margin-top: 20rpx;
		background-color: #f2f1f1;
		padding: 20rpx;
		line-height: 40rpx;
		border-radius: 24rpx;

		.execute {
			text-align: right;
			margin-top: 40px;

			color: #FFFFFF;

			text {
				border-radius: 40rpx;
				background-color: #2979ff;
				padding: 10rpx 30rpx;
			}
		}
		.link{
			text-decoration:underline
		}
	}

	.content {
		margin: 40rpx;

		.td {
			width: 25%;
			text-align: center;
		}

		.lfet {
			width: 100%;
			margin-top: 20rpx;

			.left_app {
				width: 30%;
				text-align: center;
			}
		}

		.app_img {
			height: 80rpx;
			width: 80rpx;

			image {
				height: 100%;
				width: 100%;
			}
		}

		.img_txt {
			margin-top: 20rpx;
			width: 100%;
		}

		.app_btn {
			background-color: #2979ff;
			color: #FFFFFF;
			border-radius: 40rpx;
			overflow: hidden;
			// padding: 10rpx 40rpx;

		}

		.centent {

			.txt {
				line-height: 40rpx;
				letter-spacing: 2rpx;
				font-size: 20rpx;
			}
		}

	}
	
	.deploy_btn{
		background-color: #2979ff;
		padding: 20rpx;
		color: #FFFFFF;
		margin-top: 20rpx;
		text-align: center;
		border-radius: 40rpx;
	}
</style>
